package com.data.controller;

import com.data.queue.MyDelayedTask;
import com.data.service.StudentService;
import com.data.update.StudentUpdate;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.concurrent.DelayQueue;
import java.util.concurrent.Delayed;

/**
 * @author: wangMQ
 * @create: 2024-01-03 11:29
 **/
@RestController
@RequestMapping("/student")
public class StudentController {

    @Resource
    private StudentService studentService;

    /**
     * 根据id查找学生信息
     * @param id 学生id
     * @return  {@link String }
     * @author wangmq
     * @time 2024/1/3 14:36
     */
    @GetMapping("/getStudentById")
    public String getStudentById(@RequestParam("id") String id){
        studentService.getStudentById(id);
        return id;
    }

    /**
     * 根据id新增或修改学生
     * @param studentUpdate 更新对象
     * @return  {@link String }
     * @author wangmq
     * @time 2024/1/3 14:52
     */
    @PostMapping("/upsertStudentById")
    public String upsertStudentById(@RequestBody StudentUpdate studentUpdate){
        System.out.println("修改学生");
        return "";
    }


    /**
     * 根据id删除学生
     * @param
     * @return  {@link String }
     * @author wangmq
     * @time 2024/1/3 16:09
     */
    @PostMapping("/deleteStudentById")
    public String deleteStudentById(){

        return "";
    }

    /**
     * 根据classId查找学生列表
     * @param classId 班级id
     * @return  {@link String }
     * @author wangmq
     * @time 2024/1/3 16:18
     */
    @GetMapping("/getStudentListByClassId")
    public String getStudentListByClassId(@RequestParam("classId") String classId){
        System.out.println("321");
        return "";
    }

}
